<template>
  <div class="tuichudenglu">
    <ul class="mui-table-view">
      <li class="mui-table-view-cell mui-media">
        <div class="mui-media-body" @click="logout">
          退出登录{{ $store.state.username }}
        </div>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  data() {
    return {
      logoutForm: {
        username: "",
        password: "",
        session_id: "",
      },
    };
  },
  methods: {
    logout() {
      console.log(this.$store.getters['user/isLogin'])
      if (this.$store.getters['user/isLogin']) {
        this.$store.commit("user/logout");
        this.$toast.showMessage("退出登录");
        console.log(this.$store.getters['user/isLogin'])
      }else{
        this.$toast.showMessage("请先登录");
      }
    },
  },
};
</script>
<style scoped>
.mui-table-view {
  margin-top: 2rem;
}
.mui-table-view .mui-media,
.mui-table-view .mui-media-body {
  line-height: 30px;
  background: #fff;
  font-size: 20px;
}
</style>
